//
//  def_jump_statement.h
//  compilation
//
//  Created by Kevin Le perf on 17/01/12.
//  Copyright (c) 2012 e2co technologie. All rights reserved.
//

#ifndef compilation_def_jump_statement_h
#define compilation_def_jump_statement_h

/*
 jump_statement
 : RETURN ';' {printf("jump_statement\n");}
 | RETURN expression ';' {printf("jump_statement\n");}
 ;

 */

struct def_jump_statement{
	void * parent;
	int type;
	struct def_expression * expression;
};

struct def_jump_statement * jump_statement_create(void * parent){
	struct def_jump_statement * d = malloc(sizeof(*d));
	d->type = 0;
	d->parent = parent;
	return d;
}

void jump_statement_print(struct def_jump_statement * d){
	switch(d->type){
		case 1:
			printf("return");
			break;
		case 2:
			printf("return");
			printf(" ");
			expression_print(d->expression);
	}
}
#endif
